package lmf;

import java.util.ArrayList;

import org.w3c.dom.Document;
import org.w3c.dom.NodeList;

public class WeeklyChartLFM {

	protected ArrayList<ArtistLFM> ranked_list;
	/*
	 * order of the artist, spesifies rank
	 */
	
	public WeeklyChartLFM(Document doc){
		ranked_list = new ArrayList<ArtistLFM>();
		NodeList nl = doc.getElementsByTagName("artist");
		for (int i = 0; i < nl.getLength(); i++) {
			ranked_list.add(new ArtistLFM(nl.item(i)));
		}
	}
	
	public int getSize(){
		return ranked_list.size();
	}
	
	public ArtistLFM getArtist(int rank){
		return ranked_list.get(rank);
	}
	
	public int getRank(ArtistLFM a){
		return ranked_list.indexOf(a);
	}
}
